#ifndef __renderer_h__
#define __renderer_h__

#define VERTS_NUM 100
enum RRPrimType {RR_LINE, RR_LINESTRIP, RR_LINELOOP, RR_TRIANGLE, RR_POLYGON};

#endif

class RRVertex
{
 public:
  float x, y, z, w;
  float c[4];
};

class RRPrim
{
 private:
  RRPrimType t;
  RRVertex verts[VERTS_NUM];
  int verts_index;

 public:
  explicit RRPrim();
  void rrSetType(RRPrimType arg);
  void rrSetVert(RRVertex arg);
  RRVertex rrGetVert(int index);
  RRVertex *rrGetVertAdrs(int index);
  int rrGetVertsNum();
};

class RRViewport
{
 private:
  RRPrim *prim;
  float n, f;
  float width, height;
  float ox, oy;

 public:
  explicit RRViewport();
  void rrViewportTrans(RRPrim *arg);
};

class RRRenderer
{
 private:
  RRPrim prim;
  RRVertex vert;
  float color[4];
  RRViewport viewport;

 public:
  void rrBegin(RRPrimType type);
  void rrEnd();
  void rrSetVert3f(float x, float y, float z);
  void rrColor4f(float a, float r, float g, float b);
  void rrPrintVert(int index);
};
